﻿namespace Datav.Design
{
    /// <summary>
    ///
    /// </summary>
    public class CaptchaResult
    {
        /// <summary>
        /// 验证码唯一Id（用于验证）
        /// </summary>
        public long Id { get; set; }

        /// <summary>
        /// 验证码显示字符
        /// </summary>
        public string CaptchaCode { get; set; }

        /// <summary>
        /// 验证码存储值（用于验证用户输入）
        /// </summary>
        public string CaptchaValue { get; set; }

        /// <summary>
        /// 验证码图片字节数组
        /// </summary>
        public byte[] CaptchaBytes { get; set; }

        /// <summary>
        /// 验证码生成时间
        /// </summary>
        public DateTime Timestamp { get; set; }

        /// <summary>
        /// 验证码图片数据编码为Base64字符串值
        /// </summary>
        public string Base64Data => Convert.ToBase64String(CaptchaBytes);
    }

    /// <summary>
    ///
    /// </summary>
    public enum CaptchaType
    {
        Normal,
        Expression
    }
}